﻿(function () {
    var myApp = angular.module('MyControllers');

    // 考点信息需要的控制器及方法列表
    myApp.controller('examClientController', ['$scope', '$http', '$modal', '$interval', 'examClientService', 'utils', function ($scope, $http, $modal, $interval, service, utils) {
        var srv = service;

        $scope.getInfo = function () {
            srv.getLocalIP().success(function (data) {
                $scope.localIP = data;
            });
            srv.getOperPassword().success(function (data) {
                $scope.operPassword = data;
            });
        };

        $scope.init = function () {
            // 每小时刷新一次
            var timer = $interval(function () {
                $scope.getInfo();
            }, 1000 * 60 * 60);
            utils.setData({ timer1: timer });
        };

        $scope.getInfo();
        $scope.init();
    }]);
})();